home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tskerm25.zip / GETBIN.CMD < prev    next >
OS/2 REXX Batch file  |  1994-02-09  |  2KB  |  52 lines

  1. ;
  2. ; GETBIN.CMD by Prof. Timo Salmi, ts@uwasa.fi, Wed 9-Feb-94
  3. ; A script to get a binary file from a Unix host to your PC
  4. ;
  5. ; To run getbin.cmd script give kermit command:
  6. ;     take getbin.cmd [filename]
  7. ; Or if you have run take zset.cmd then just give kermit command:
  8. ;     getbin [filename]
  9. ;
  10. ; Error handling
  11. def errstop echo \%1\7\13, define \%1, stop
  12. if not defined \%1 ask \%f Get which binary file?
  13. if defined \%1 define \%f \%1
  14. if not defined \%f errstop {Error: You have not defined the filename variable}
  15. ;
  16. set take-echo on         ;Show what is happening
  17. clear                    ;Clear the input buffer
  18. set parity none          ;CHANGE as your system might require
  19. set receive packet 1024  ;Use long packets
  20. set file type binary     ;This is a binary transfer
  21. set take-echo off        ;Enough of displaying the comments
  22. ;
  23. pause 1                            ;Let's not be too hasty about it :-)
  24. output kermit\13                   ;Invoke Unix C-kermit
  25. pause 1
  26. output set file type binary\13     ;E.g. if it is and .arc file
  27. pause 1
  28. output set parity none\13          ;CHANGE as your system might require
  29. pause 1
  30. output set send packet 1024\13     ;Use long packets (C-Kermit)
  31. pause 1
  32. output send \%f\13                 ;Start sending the file from host
  33. pause 1
  34. ;
  35. input 5 ?File not found            ;Check that host has the file
  36. if fail goto label1
  37. echo \13Host reported an error\7\7\7\7\7\13
  38. echo \13
  39. goto label2                        ;Don't try to receive
  40. ;
  41. :LABEL1
  42. receive r:\                        ;Where to put the file in your PC
  43. ;                                  ; change the path as applicable
  44. :LABEL2
  45. pause 5                            ;A longer pause is required here
  46. output quit\13                     ;Quit host kermit
  47. pause 1
  48. define \%f                         ;Release filename
  49. define \%1                         ;Release parameter
  50. pause 1
  51. echo \13Script GETBIN.CMD by Prof. Timo Salmi, Done
  52.